package memo.model.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import memo.model.vo.MemoPagingVO;
import memo.model.vo.MemoVO;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class MemoDaoImpl extends SqlMapClientDaoSupport implements MemoDao {

	@Override
	public MemoVO selectShowContent(MemoVO vo) throws SQLException {
		return (MemoVO) this.getSqlMapClient().queryForObject("memo.selectShowContent", vo);
	}
	@Override
	public String selectGetSequence() throws SQLException {
		return (String) this.getSqlMapClient().queryForObject("memo.selectGetSequence");
	}

	@Override
	public List selectShowMemoList(int empNo) throws SQLException {
		return this.getSqlMapClient().queryForList("memo.selectShowMemoList",empNo);
	}
	@Override
	public List<MemoVO> selectGetContents(MemoPagingVO vo) throws SQLException {
		return  (List) this.getSqlMapClient().queryForList("memo.selectGetContents",vo);
	}
	@Override
	public String selectGetTotalContents() throws SQLException {
		return (String) this.getSqlMapClient().queryForObject("memo.selectGetTotalContents");
	}
	@Override
	public MemoVO selectShowMemo(int memoNo) throws SQLException {
		return (MemoVO) this.getSqlMapClient().queryForObject("memo.selectShowMemo",memoNo);
	}
	@Override
	public void updateMemo(MemoVO vo) throws SQLException {
		this.getSqlMapClient().update("memo.updateMemo", vo);
	}
	@Override
	public void deleteMemo(int memoNo) throws SQLException {
		this.getSqlMapClient().delete("memo.deleteMemo",memoNo);
		
	}
	@Override
	public void insertWriteMemo(MemoVO vo) throws SQLException {
		this.getSqlMapClient().insert("memo.insertWriteMemo",vo);
		
	}



}
